import axios from '@/api/fetch';
// import * as types from './types';
import { getCompanyId } from '@/assets/js/auth';
import SERVER from '@/api/server';
/* 操作员、录入人 */
export const getAllUser = () => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/users/getDealerUser`);
/* 销售回访-任务分派 */
export const allotVisit = params => axios.post(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/sales/returnVisit/taskAssignment`, params);
/* 获取未分配销售回访信息 */
export const getSaleVisitInfo = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/sales/returnVisit/findAll`, { params });
/* 获取未分配售后回访信息 */
export const getServiceVisitInfo = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customerCare/visitAllocation/getServiceVisitInfo`, { params });
/* 获取未分配活动回访信息 */
export const getActivityVisitInfo = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customerCare/visitAllocation/getActivityVisitInfo`, { params });
/* 获取未分配二手车信息 */
export const getUsedCarVisitInfo = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customerCare/visitAllocation/getUsedCarVisitInfo`, { params });
/* 获取未分配潜客回访信息 */
export const getSneakVisitInfo = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customerCare/visitAllocation/getSneakVisitInfo`, { params });
/* 获取未分配战败回访信息 */
export const getDefeatVisitInfo = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customerCare/visitAllocation/getDefeatVisitInfo`, { params });
export const searchRoleByCodes = params => {
  params.companyId = getCompanyId();
  return axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/roles/getUserInfoByRolePosition`, {
    params
  });
};
